class CreateGroups < ActiveRecord::Migration
  def self.up
    create_table :groups do |t|      
      t.string :name, :limit => 45, :null => false
      t.integer :task_quote, :default => 5
      t.integer :discount, :default => 0
      t.boolean :may_print,  :default => false
      t.boolean :may_view,  :default => false
      t.boolean :may_delete,  :default => false
      t.boolean :may_add,  :default => false
      t.boolean :may_change,  :default => false
      t.timestamps
    end

    Group.create :name => "Administratorzy", :may_print => true, :may_view => true,
      :may_delete => true, :may_add => true, :may_change => true
    Group.create :name => "Użytkownicy", :may_add => true
    
  end

  def self.down
    drop_table :groups
  end
end
